package org.jeecg.modules.zcgl.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.zcgl.entity.AssetFixed;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.zcgl.vo.AssetFixedVo;

/**
 * @Description: 固定资产
 * @Author: jeecg-boot
 * @Date:   2021-06-30
 * @Version: V1.0
 */
public interface AssetFixedMapper extends BaseMapper<AssetFixed> {
    //获取今日数量
    @Select("select count(1) from zcgl_asset_fixed where asset_type = #{type} and (asset_fixed_category_id is null or asset_fixed_category_id = '')")
    int getTypeCount(String type);


    //判断哪些物资在仓库的数量低于警戒线
    @Select("SELECT\n" +
            "a.amount,a.name,a.code ,a.jiexian\n" +
            "FROM\n" +
            "\t`zcgl_asset_fixed` a \n" +
            "\t where a.amount < a.jiexian\n" +
            "\t and del_flag = 0 \n" +
            "\n" +
            "\t\n" +
            "\t\n")
    List<AssetFixedVo> getJieXianList();

}
